package com.exam.system.service.impl;

import com.exam.system.dao.ExamRoleDao;
import com.exam.system.dao.ExamUserDao;
import com.exam.system.entity.ExamRole;
import com.exam.system.entity.ExamUser;
import com.exam.system.redis.RedisUtils;
import com.exam.system.service.ExamRoleService;
import com.exam.system.service.ExamUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * @ClassName ExamUserServiceImpl
 * @Description 用户service层
 * @Author ckl
 * @DATE 2021/5/30 17:54
 * @versions 1.0
 */
@Service
@Transactional
public class ExamRoleServiceImpl implements ExamRoleService {
    @Autowired
    private ExamRoleDao examRoleDao;

    @Override
    public List<ExamRole> findAllRole() {
        return examRoleDao.findAllRole();
    }

    @Override
    public ExamRole findRoleById(Integer id) {
        return examRoleDao.findRoleById(id);
    }

    @Override
    public void updateById(ExamRole examRole) {
        examRoleDao.updateById(examRole);
    }

    @Override
    public ExamRole insertRole(ExamRole examRole) {
examRole.setIsdel("n");
examRole.setCreateTime(new Date());
examRole.setStatus("y");
        examRoleDao.insertRole(examRole);
        return  null;
    }
}
